#ifndef N1BINSTREAM_H_2009_10_01
#define N1BINSTREAM_H_2009_10_01

#include "N0Lib.h"

class N1Stream {
protected:
    bool m_isWriteStream;

    virtual void read(void* data, uint32 size)=0;
    virtual void write(const void* data, uint32 size)=0;

public:
    virtual ~N1Stream() {};

    virtual bool isReadStream() { return !m_isWriteStream; };
    virtual bool isWriteStream() { return m_isWriteStream; };

    N1Stream& operator&(int8 &v);
    N1Stream& operator&(uint8 &v);

    N1Stream& operator&(int16 &v);
    N1Stream& operator&(uint16 &v);

    N1Stream& operator&(int32 &v);
    N1Stream& operator&(uint32 &v);

    N1Stream& operator&(int64 &v);
    N1Stream& operator&(uint64 &v);

    N1Stream& operator&(float &v);
    N1Stream& operator&(double &v);

    N1Stream& at(void* ptr, uint32 size);
};

#endif //N1BINSTREAM_H_2009_10_01
